
<!DOCTYPE html><html>
    <head>
        <meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="renderer" content="webkit"><meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/><title>登录</title>
        <link rel="icon" href="../cas/images/favicon.ico" type="image/x-icon"/>
        <link rel="stylesheet" href=""/><script src=""></script>
        <link href="../css/cas.css" rel="stylesheet"/>
        <link href="../css/login.css" rel="stylesheet"/>
        <link href="../css/style.css" rel="stylesheet"/>
        <script type="text/javascript" src="../js/jquery.min.js" ></script>
        <script type="text/javascript" src="../js/cookies.js" ></script>
        <!--[if lt IE 8]>
        <script>
            alert('请使用IE8及以上IE浏览器')
        </script>
        <![endif]--></head>
    
    <body  class="container">
    <h1></h1>
    <div>
        <div class="login">
            <img class="logo" src="../images/new_images/logo.png" alt=""><div class="line"></div>
            <p class="tip">使用用户名登录</p>
    
            <form method="post" id="fm1" class="clearfix login-form" onsubmit="return false;">
                <div id="errorMsg" class="alert alert-danger" style="display: none; color: red;">
                </div>
                <br><!-- 用户名 --><span class="icon user fl"></span>
                
                <section class="row" style="float:right">
                    <div class="inputBox">
                        <input class="required   fl  mouseleave  username"
                            placeholder="请输入用户名"
                               id="username"
                               size="25"
                               tabindex="1"
                               type="text"
                               accesskey="n"
                               autocomplete="off" name="username" value=""/>
                    </div>
                </section>
                <div style="clear:both"></div>
                 <div class="line"></div>
                <!-- 密码 --><span class="icon pwd fl"></span>
                <section class="row" style="float:right">
                    <div  class="inputBox">
                        <input class="required  fl mouseleave password"
                               placeholder="请输入密码"
                               type="password"
                               id="password"
                               size="25"
                               tabindex="2"
                               accesskey="p"
                               autocomplete="off" name="password" value=""/></div>
                </section>
                <div style="clear:both"></div>
                <div class="line"></div>
                <!-- 验证码 --><span class="icon code fl"></span>
                <section class="row" style="float:right">
                    <div class="inputBox">
                        <input class="required input-val   fl mouseleave"
                               placeholder="请输入验证码" 
                               maxlength="4"
                               id="captcha"
                               name="capcha"
                               size="25"
                               tabindex="3"
                               autocomplete="off"/><img id="captcha_img" src="/captcha" style="width: 110px;height:36px;margin-top: -9px" onclick="changeCode()" class="fr"></div>
                </section>
                <div style="clear:both"></div>
                <div class="line"></div>
                <span class="icon key fl"></span>
                <a  class="fl" style="margin: 2px 0 0 -10px; text-decoration:none;color: #0099FF" href="javascript:void(0)" onclick="$('#passwordManagementForm').submit();">忘记密码</a>
                <br><div style="clear:both"></div>
                <section>
                    <input type="hidden" name="execution" value="e125e10f-ef5c-456c-aa02-9c64cc1dc6b4_ZXlKaGJHY2lPaUpJVXpVeE1pSjkuRExkUjA4c1l4OWhLYThVSitFL251cVVEUTNFY0VaUDROSHloWW44YjlNOWdTTWpIaUd3Q1dBQ3NDMVY5Y2E1azBsU0Ziejd6K3lJUzY4MUs3RFl3ZWlEWEFDUHNHWFp4Uld5T0Jodk05cGV6cXM5YjNUQXVjOHI5cWZ3MmlSK2E1dEVocUhwWnJIVEg4TXhBbDdVSEx5Tlh5WlM0ZTlHVW1KdTVNQzZVV0paOWkrRlVlUUczbVNQRkFId3pMbXhTZ3VZdUx6R1hPUktPQml4UktIWlozcllTcjgyWXQ2a29ObFVRSURSSmRTVGlZeUI3RHIydVFJY3BTSFJUQmRJMktUTGxkSE1YMkZRdSsxblExWEM4L2djZUllOVh2VTg5OEdTNHlIQzhOZkl6Q29NdkNsOFpXakhuMnovUzg0YXhlMHcxcHpNL3gvUnZ1MWtuaEpQK3hoRGdvYzdCaUc0Z0VPZEx0aDBDMG00OW5YQjhUcmsvMVF0V3hiTmdxK3hhaUNmc1dTczdXbGZWRFpHZXNPRklOUzYzeUFTeDh5djE2QUdOVUFzS2JucWYxMzhnYmVHa0dwMmF2WnZ6Unk0cGtvZmljelA0cVArWVJPMWhpcmE2bFB1RVVLZHNta1pQZ0pqOU1WejNucjBSOVc5TWVHVHc3a0VzTVpJRjNFeiszOUE3cEQrV3MrbmlSS2lLWDl1NlkyK0NwemRINjc3VU5NVEwrYmRySjVMWm1xU3BiWFF0TlloRy9JbnlucEk5bTJ6TWNFbE9SQndmR0VyNjV4eUR3RjVURm5oNlU4Q3ZZUFBGK0laeDVjRi9vUUcrOXpGOXM5NTJhTmIrTzZxLy9MdEhEa3hXVkJkMWNoMGoybU0rM1NhZ3VDRHZwRGM4UnlHYzNENDJUcURqNW5QSXFyZ2tMaWxtWUR1Y2kyVmNvSXkwZDRmTGpubENSNjlTVk53aUNTYjN5NkxhT0xGaWRSRitSVW9OdllPb0VjTThCWmhBdXRicThtc2NTUmVRTXFiRXBuREhnc0xtbytyMmNKZ2xSMWNBQW0valVqUS94OStNemR2MGl6NVdza1ZoQWZLYUdSSFp3MmtVWUExTHdnSS9KdXBIM3dMSjREVTc4ZXp5eE5vL05pNElEUHZnWng5NjFacGVzeWlnVlNoeUlXb0RYYXErTE1hYXB4WXpJUDVjUzV5NmdXWVNVT3pYa0VsYlllOWs3VVprZWxzQk1tZDI0b0pWbDd4d2xnQUNPR3J5ZStIb1pSRHNOUHNXS0FhakRJUEFGOWlOZHE5VFJkT085eDI0ekJhL0JHTjhMdmI1S0ZUY2paYWJ0cG1ac3hzemo2a0Vzak9qNjdFNXc0bDhJNE1vZUlqcHpncUd4dzNHZnNwL25LS3crV0RZeHpRVElzTWI3SzJpdlVicHIweHZNbHorZlR2Q1o2ejI0VWo3K2RoZDNKQVJJZWgyR01IT0hWajRmU0RzRFlDK0pvY0h5M1QxVjg0PS43ckN3eW9fQnZJMFlqRXVOZC1OU3ZEQW84aFJveWFzR2F3cGs5ZmxKYm9ZbXJLYWJVVmozTUd0NzZpbjZqNlBMYkpoWTFkaG0zT2Y0bWEtenc3MWVDQQ=="/>
                    <input type="hidden" name="_eventId" value="submit"/>
                    <input type="hidden" name="geolocation"/>
                    <input id="login-btn" class="btn btn-submit btn-block  login-button"
                           name="submit"
                           accesskey="l"
                           value="登录"
                           tabindex="6"
                           type="submit"/>
                </section>
            </form>
        </div>
        <form method="post" id="passwordManagementForm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SRitSVW9OdllPb0VjTThCWmhBdXRicThtc2NTUmVRTXFiRXBuREhnc0xtbytyMmNKZ2xSMWNBQW0valVqUS94OStNemR2MGl6NVdza1ZoQWZLYUdSSFp3MmtVWUExTHdnSS9KdXBIM3dMSjREVTc4ZXp5eE5vL05pNElEUHZnWng5NjFacGVzeWlnVlNoeUlXb0RYYXErTE1hYXB4WXpJUDVjUzV5NmdXWVNVT3pYa0VsYlllOWs3VVprZWxzQk1tZDI0b0pWbDd4d2xnQUNPR3J5ZStIb1pSRHNOUHNXS0FhakRJUEFGOWlOZHE5VFJkT085eDI0ekJhL0JHTjhMdmI1S0ZUY2paYWJ0cG1ac3hzemo2a0Vzak9qNjdFNXc0bDhJNE1vZUlqcHpncUd4dzNHZnNwL25LS3crV0RZeHpRVElzTWI3SzJpdlVicHIweHZNbHorZlR2Q1o2ejI0VWo3K2RoZDNKQVJJZWgyR01IT0hWajRmU0RzRFlDK0pvY0h5M1QxVjg0PS43ckN3eW9fQnZJMFlqRXVOZC1OU3ZEQW84aFJveWFzR2F3cGs5ZmxKYm9ZbXJLYWJVVmozTUd0NzZpbjZqNlBMYkpoWTFkaG0zT2Y0bWEtenc3MWVDQQ=="/><input type="hidden" name="_eventId" value="resetPassword"/><p/></form>
    </div>
    
    </body>
    <script type="text/javascript">

        $(function () {
            let url=window.location.href;
            let aa=url.indexOf('?');
            if (aa>-1){
                url=url.substring(aa+1); //获取到商品的id信息
            }
            console.log(url)
        })

        function changeCode(){
            //刷新验证码
            $("#captcha_img").attr('src','/captcha?id='+Math.random());
        }

        const errorMsg = $('#errorMsg')

        $('#login-btn').on('click', function() {
            let username = $('#username').val()
            let password = $('#password').val()
            let captcha = $('#captcha').val()
            let data = {username, password, captcha}
            $.ajax({
                url: '/cas/login',
                type: 'post',
                data: data,
                dataTypedata: 'json'
            }).then(res => {
                if(res.code < 0) {
                    errorMsg.css('display', 'block')
                    errorMsg.text(res.message)
                }else {
                    setCookie("username", res.data, 86400)
                    let url=window.location.href;
                    let aa=url.indexOf('?');
                    if (aa>-1){
                        url=url.substring(aa+1); //获取到商品的id信息
                    }
                    location.href = '/html/' + url  // 跳转到主页
                }
            })
        })

        $('#username, #password, #captcha').on('focus', () => { errorMsg.css('display', 'none')})
    </script>
    
</html>
    